package com.yunxi.service.dubboService.impl.sto;

import com.yunxi.sto.service.VehicleMaintainItemDubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.lang.reflect.InvocationTargetException;
import com.yunxi.sto.pojo.VehicleMaintainItemVO;
import java.util.Map;
import java.util.List;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunxi.service.localService.sto.VehicleMaintainItemService;
import com.yunxi.model.sto.VehicleMaintainItem;

/**
 * <p>
 * 车辆库存保养项目 服务实现类
 * </p>
 *
 * @author Guan
 * @since 2019-10-14
 */
public class VehicleMaintainItemDubboServiceImpl implements VehicleMaintainItemDubboService {

    @Autowired
    @Qualifier(value = "vehicleMaintainItemServiceImpl")
    VehicleMaintainItemService vehicleMaintainItemService;


    @Override
    public VehicleMaintainItemVO getById(String id) throws InvocationTargetException, IllegalAccessException {
        VehicleMaintainItem vehicleMaintainItem = vehicleMaintainItemService.getById(id);
        VehicleMaintainItemVO vehicleMaintainItemVO = new VehicleMaintainItemVO();
        BeanUtils.copyProperties(vehicleMaintainItem,vehicleMaintainItemVO);
        return vehicleMaintainItemVO;
    }

    @Override
    public void saveOrUpdate(VehicleMaintainItemVO vehicleMaintainItemVO) throws InvocationTargetException, IllegalAccessException {
        VehicleMaintainItem vehicleMaintainItem = new VehicleMaintainItem();
        BeanUtils.copyProperties(vehicleMaintainItemVO,vehicleMaintainItem);
        vehicleMaintainItemService.saveOrUpdate(vehicleMaintainItem);
    }

    @Override
    public void removeById(String id) {
        vehicleMaintainItemService.removeById(id);
    }

    @Override
    public PageInfo<VehicleMaintainItemVO> findPageByVO(VehicleMaintainItemVO vehicleMaintainItemVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
        PageInfo<VehicleMaintainItemVO> pageInfo = vehicleMaintainItemService.pageByVo(vehicleMaintainItemVO,pageNum,pageSize);
        return pageInfo;
    }

    @Override
    public void removeByListVo(List<VehicleMaintainItemVO> vehicleMaintainItemVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        vehicleMaintainItemService.removeByListVo(vehicleMaintainItemVOList);
    }

    @Override
    public List listByVo(VehicleMaintainItemVO vehicleMaintainItemVO) {
        return vehicleMaintainItemService.listByVo(vehicleMaintainItemVO);
    }
}
